home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-04-25 | 3.8 KB | 110 lines | [TEXT/CWIE] |
- // ==================================================
- // CTouchMeMainWindow.h
- // Copyright (C) 1996-1997 Mizutori Tetsuya
- // July 4, 1996; February 3, 1997; April 23, 1997.
- // ==================================================
- // All documents are pretty-printed in 10-point Geneva font.
-
- #pragma once
-
- #include <LDialogBox.h>
- #include <LBroadcaster.h>
- #include <LDragAndDrop.h>
- #include <LCommander.h>
-
- #include "CPrefsFile.h"
- #include "CTouchMePref.h"
-
-
- class LCommander;
-
-
- class CTouchMeMainWindow : public LDialogBox , public LBroadcaster, public LDragAndDrop {
-
- public:
- enum { class_ID = 'TmeD' };
-
- static CTouchMeMainWindow * CreateTouchMeMainWindowStream( LStream *inStream );
- CTouchMeMainWindow( LStream *inStream );
- ~CTouchMeMainWindow();
-
-
- virtual void FindCommandStatus( CommandT inCommand,
- Boolean &outEnabled, Boolean &outUsesMark,
- Char16 &outMark, Str255 outName );
-
- // Control the synchronous RadioButton changes
- // Control the 'Current Date Time Now!' button, and others
- virtual void ListenToMessage( MessageT inMessage, void *ioParam );
-
- // Set and Get dialog status according to the 'CTouchMePref' instance data
- // Get the global frame rect, a bound of dialog
- void GetGlobalFrameRect( Rect & outRect );
- // Move the dialog window
- void MoveWindow( Rect & inRect );
- // Setup dialog status according to the 'pref' data
- void SetupDialog( const SPrefsRec & inPrefs );
- // Set the 'pref' data according to the dialog status
- void InspectDialog( SPrefsRec & outPrefs );
- // Show an indiactor whether the modifier key is pressed
- void Indicator( const Boolean inStatus );
-
- protected:
-
- // for Dialog
- // Add listeners of RadioButtons to broadcaster of LStdCheckBox
- virtual void FinishCreateSelf( void );
- // Draw my additional figures in the dialog window
- virtual void DrawSelf( void );
- // Quit program like as "Cancel" button if "Close Box" was selected
- virtual void AttemptClose( void );
-
- private:
-
- // for Dialog
- void SetEditFieldText( PaneIDT inPane, const Str255 inString,Boolean toSelectAll = false );
- void SetEditFieldTextRefresh( PaneIDT inPane, const Str255 inString,Boolean toSelectAll = false );
- void GetEditFieldText( PaneIDT inPane, Str255 outString,Boolean toSelectAll = false );
- void SetEditFieldDateTime( PaneIDT inPane, const unsigned long inDateTimeSeconds,Boolean toSelectAll = false );
- PaneIDT GetPairedPaneID( const PaneIDT inPaneID );
-
- // static Boolean sGlobalModifier;
- Boolean mGlobalModifier;
-
- protected:
- // for Drag and Drop
- // Drag&Drop; accept files or folders dropped from Finder
- virtual Boolean ItemIsAcceptable( DragReference inDragRef, ItemReference inItemRef );
-
- // Drag&Drop; retrieve the FSSpec from the dropped object
- // Set the date time stamp fields according to the accepted file
- // Or do touch command if option-key is pressed
- virtual void ReceiveDragItem( DragReference inDragRef,
- DragAttributes inDragAttrs, ItemReference inItemRef, Rect &inItemBounds );
- // Drag&Drop; execute once if entered into the area
- virtual void EnterDropArea( DragReference inDragRef, Boolean inDragHasLeftSender );
- // Drag&Drop; execute once if left from the area
- virtual void LeaveDropArea( DragReference inDragRef );
- // Drag&Drop; execute while staying in the area
- virtual void InsideDropArea( DragReference inDragRef);
- // Drag&Drop; assign my custum hilite region of EditFields
- virtual void HiliteDropArea( DragReference inDragRef );
-
- private:
-
- // for Drag and Drop
- Boolean IsModifierKeyPressed( DragReference inDragRef );
- PaneIDT FindPaneByMouse( const Point inPoint );
- void HilitePane( const PaneIDT inPaneID );
- void HiliteRect( const Rect & inRect );
-
- Boolean mTEActive;
- Boolean mModifier;
- Boolean mTextDrag;
- PaneIDT mHilitePaneID;
- PaneIDT mTargetID;
- LCommander * mTarget;
- };
-
- // end of definitions
-